package com.feri.gpstudy.controller;

import com.feri.gpstudy.bo.NurseAddBo;
import com.feri.gpstudy.bo.NurseWhereBo;
import com.feri.gpstudy.bo.UserWhereBo;
import com.feri.gpstudy.entity.Nurse;
import com.feri.gpstudy.service.intf.NurseService;
import com.feri.gpstudy.vo.R;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("api/nurse/")
public class NurseController {
    /**
     * 注入业务逻辑层对象
     */
    @Resource
    private NurseService service;

    @PostMapping("save.do")
    public R save(@RequestBody NurseAddBo bo) {
        return service.save(bo);

    }

    /**
     * 修改内容*/
    @PostMapping("update.do")
    public R update(@RequestBody Nurse nurse) {
        return service.update(nurse);
    }

    /**
     * 查询 所有数据*/
    @GetMapping("all.do")
    public R all(NurseWhereBo bo){
        return service.queryAll(bo);
    }

    /**
     * 根据 nid 查询 所有数据*/
    @GetMapping("single.do")
    public R single(Integer nid){
        return service.queryById(nid);
    }
    /**
     * 增加新数据
     */
    @PostMapping("add.do")
    public R add(Nurse nurse) {
        return service.add(nurse);
    }


}

